package com.thwj.project.biz.enums;

/***
 * 取消报名无责退费时效
 */
public enum ActivityCancelBeforeTypeEnum {


    start(1,"活动开始前",0),
    minute_15(2,"前30分钟",30*60),
    hour_1(3,"前1小时",1*60*60),
    hour_2(4,"前2小时",2*60*60),
    hour_3(5,"前4小时",4*60*60),
    hour_4(6,"前8小时",8*60*60),
    hour_5(7,"前12小时",12*60*60),
    hour_6(8,"前1天",24*60*60),
    hour_7(9,"前2天",2*24*60*60),
    hour_8(10,"前3天",3*24*60*60),
    hour_9(11,"前7天",7*24*60*60),
    cannot(100,"不可取消",null),
    ;
    ActivityCancelBeforeTypeEnum(int value, String name,Integer secondBefore){
        this.name = name;
        this.value = value;
        this.secondBefore = secondBefore;
    }

    private int value;
    private String name;
    private Integer secondBefore;

    public Integer getSecondBefore() {
        return secondBefore;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }



    public static ActivityCancelBeforeTypeEnum getEnumByValue(Integer value){
        for (ActivityCancelBeforeTypeEnum activityCancelBeforeTypeEnum : ActivityCancelBeforeTypeEnum.values()) {
            if(activityCancelBeforeTypeEnum.value == value) {
                return activityCancelBeforeTypeEnum;
            }
        }
        return null;
    }
}
